<!--修改计划页面-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div    id="content">
    <section class="content-header">
        <h1>
            <i class="fa fa-dashboard"></i>
            <strong>应收账管理</strong>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-home "></i>Home</a></li>
            <li>应收账计划</li>
            <li class="active">计划修改</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-info">
                        <form id="contractInfoEdit">
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td width="8%" class="center">合同编号</td>
                                    <td width="16%">
                                        <div class="col-md-11">
                                            <input class="form-control" type="text"  readonly="readonly" name="code" th:value="${contract.supplierCode}"/>
                                            <input class="form-control" type="hidden" id="contractId" name="contractId" th:value="${contract.Id}"/>
                                            <input class="form-control" type="hidden" id="contractType" name="contractId" th:value="${contract.contractType}"/>
                                        </div>
                                    </td>
                                    <td width="8%" class="center">公司名称</td>
                                    <td width="16%">
                                        <div class="col-md-12">
                                            <input class="form-control" type="text" readonly="readonly" name="compName" th:value="${contract.orderUnit}"/>
                                        </div>
                                    </td>

                                    <td width="8%" class="center">合同总额（元）</td>
                                    <td width="16%">
                                        <div class="col-md-11">
                                            <input class="form-control" type="text"  readonly="readonly" name="paySum" id="paySum" th:value="${#numbers.formatDecimal(contract.totalSum,1,2)}"/>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="8%" class="center">负责人</td>
                                    <td width="16%">
                                        <div class="col-md-11">
                                            <input class="form-control" type="text" readonly="readonly" name="receiver" th:value="${contract.dutyOfficer}"/>
                                        </div>
                                    </td>
                                    <td width="8%" class="center">签订时间</td>
                                    <td width="16%">
                                        <div class="col-md-12">
                                            <input class="form-control" type="text"
                                                   readonly="readonly" id="signedDate1"
                                                   disabled="disabled"/>
                                            <input class="hide" type="text"
                                                   readonly="readonly" id="signedDate"
                                                   disabled="disabled"
                                                   th:value="${contract.signedDate}"/>
                                        </div>
                                    </td>
                                    <td width="8%" class="center">交货时间</td>
                                    <td width="16%">
                                        <div class="col-md-11">
                                            <input class="form-control" type="text"
                                                   id="giveOutDate1" readonly="readonly"
                                                   disabled="disabled"/>
                                            <input class="hide" type="text"
                                                   id="giveOutDate" readonly="readonly"
                                                   disabled="disabled"
                                                   th:value="${contract.giveOutDate}"/>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="8%" class="center">项目名称</td>
                                    <td colspan="3">
                                        <div class="col-md-12">
                                            <input class="form-control" type="text"  readonly="readonly" name="name" th:value="${contract.projectName}"/>
                                        </div>
                                    </td>
                                    <td width="8%" class="center">片区/行业</td>
                                    <td width="16%">
                                        <div class="col-md-11">
                                            <input class="form-control" type="text" readonly="readonly" name="arae" th:value="${contract.orderArea}"/>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="8%" class="center">备注</td>
                                    <td colspan="3">
                                        <div class="col-md-12">
                                            <textarea class="form-control" style="width:100%" row="2" readonly="readonly" th:text="${contract.memo}"></textarea>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                <td width="8%" class="center">付款方式</td>
                                <td colspan="3">
                                    <div class="col-md-12">
                                        <textarea class="form-control" style="width:100%" row="2" id="payType" readonly="readonly" th:text="${contract.payType}"></textarea>
                                    </div>
                                </td>
                            </tr>
                                </tbody>
                            </table>
                    <div class="box-header with-border">
                        <i class="fa fa-th-list"></i>
                        <h4 class="box-title">应收账计划</h4>
                    </div>
                    <div class="box-body">
                        <div class="form-inline">
                            <button type="button" class="btn btn-sm btn-info pull-right editBtn">编辑计划</button>
                        </div>
                    </div>
                    <div class="box box-body">
                        <table width="100%" id="dataTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0">
                            <thead>
                            <tr>
                                <th width="1%" >序号</th>
                                <th width="1%" ><input type="checkbox" id="checkAll"/></th>
                                <th width="2%" >款项</th>
                                <th width="2%" >金额（元）</th>
                                <th width="3%" >比例</th>
                                <th width="3%" >计划收款时间</th>
                                <th width="20%" >备注</th>
                            </tr>
                            </thead>
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                            <div >
                                <a type="button" class="btn btn-default pull-right" href="javascript:history.go(-1)">返回</a>
                            </div>
                        </form>
             </div>
            </div>
          </div>
    </section>
    <!--时间编辑弹窗--> 
    <div class="modal" id="paymentEditModal">
        <div class="modal-dialog" role="dialog">
            <form id="paymentEditForm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title"><strong>修改计划时间</strong></h4>
                    </div>
                    <div class="modal-body">
                        <input type="hidden" name="id" id="id" />
                        <input type="hidden" name="createTime" id="createTime" />
                        <div class="form-horizontal">
                            <div class="form-group">
                                <label class="col-md-2 control-label">款项</label>
                                <div class="col-md-4">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text"  name="fund" id="fund" readonly="readonly" />
                                    </div>
                                </div>
                                <label class="col-md-2 control-label">金额(元)</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                        <input class="form-control" type="text" id="amount" name="amount" readonly="readonly" datatype="*,*1-100,t" nullmsg="请输入金额"/>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-md-2 control-label">计划收款时间</label>
                                <div class="col-md-4">
                                    <div class="col-md-11">
                                        <input class="form-control" type="date" name="payDate" id="payDate" />
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">备注</label>
                                <div class="col-md-8">
                                    <div class="col-md-12">
                                        <textarea class="form-control" style="width:100%" name="memo" id="memo" row="2"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary  saveBtn">保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>

                    </div>
                </div>
            </form>
        </div>
    </div>
    <script th:src="@{/payment/paymentInitial.js}"></script>
    <script>
        jQuery(function() {
            if (jQuery("#giveOutDate").val() != '') {
                var sendDate = jQuery("#giveOutDate").val();
                jQuery("#giveOutDate1").val(
                        moment(sendDate).format('YYYY-MM-DD'));
            }
            if (jQuery("#signedDate").val() != '') {
                var sendDate = jQuery("#signedDate").val();
                jQuery("#signedDate1").val(
                        moment(sendDate).format('YYYY-MM-DD'));
            }
        });
    </script>
</div>
</body>
</html>